{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "using Unums"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10x3 Array{Unums.Ubound{3,4,UInt64},2}:\n",
       "  (0.6822509765625,0.6822586059570312)       …   (1.6491546630859375,1.649169921875)    \n",
       "  (1.18438720703125,1.1844024658203125)          (0.8001861572265625,0.8001937866210938)\n",
       " (-0.7468032836914062,-0.746795654296875)       (-1.5652008056640625,-1.565185546875)   \n",
       "  (0.9019927978515625,0.9020004272460938)        (0.1008453369140625,0.1008462905883789)\n",
       "  (0.7753982543945312,0.7754058837890625)       (-1.444671630859375,-1.4446563720703125)\n",
       "  (2.15966796875,2.159698486328125)          …   (0.6262588500976562,0.6262664794921875)\n",
       "  (0.11020278930664062,0.11020374298095703)      (0.4856681823730469,0.4856719970703125)\n",
       " (-1.813262939453125,-1.8132476806640625)        (0.3639984130859375,0.3640022277832031)\n",
       "  (0.2515449523925781,0.25154876708984375)       (0.535919189453125,0.5359268188476562) \n",
       "  (1.0881805419921875,1.08819580078125)          (1.281646728515625,1.2816619873046875) "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X = map(Ubound34, randn(10,3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(\n",
       "10x3 Array{Unums.Ubound{3,4,UInt64},2}:\n",
       " (-0.1889190673828125,-0.18878173828125)        …   (0.43045806884765625,0.43311309814453125) \n",
       " (-0.3278617858886719,-0.3277931213378906)          (0.2140331268310547,0.21613121032714844)  \n",
       "  (0.20668792724609375,0.20672988891601562)        (-0.4493370056152344,-0.4474754333496094)  \n",
       " (-0.24969100952148438,-0.24963951110839844)       (-0.14296722412109375,-0.141510009765625)  \n",
       " (-0.2146453857421875,-0.21460342407226562)        (-0.5758819580078125,-0.5743026733398438)  \n",
       " (-0.5978469848632812,-0.59771728515625)        …  (-0.06056404113769531,-0.05858421325683594)\n",
       " (-0.030506372451782227,-0.030500411987304688)      (0.14625167846679688,0.14655685424804688) \n",
       "  (0.5018463134765625,0.5019454956054688)           (0.28765869140625,0.2901725769042969)     \n",
       " (-0.06963348388671875,-0.06961917877197266)        (0.20788002014160156,0.20877647399902344) \n",
       " (-0.30123138427734375,-0.30117034912109375)        (0.25113677978515625,0.25249481201171875) ,\n",
       "\n",
       "3x3 Array{Unums.Ubound{3,4,UInt64},2}:\n",
       " (-3.6129150390625,-3.61273193359375)  …  (-1.2426910400390625,-1.2418212890625)  \n",
       "   0.0                                     (0.4446220397949219,0.4466285705566406)\n",
       "   0.0                                     (2.975128173828125,2.976593017578125)  )"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Q,R = qr(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10x3 Array{Unums.Ubound{3,4,UInt64},2}:\n",
       "  (0.6820144653320312,0.68255615234375)      …   (1.6442718505859375,1.654052734375)      \n",
       "  (1.1842193603515625,1.184539794921875)         (0.7960128784179688,0.80438232421875)    \n",
       " (-0.7469024658203125,-0.7467041015625)         (-1.5685272216796875,-1.561859130859375)  \n",
       "  (0.9018783569335938,0.9021148681640625)        (0.09785842895507812,0.10383987426757812)\n",
       "  (0.775299072265625,0.7754974365234375)        (-1.447601318359375,-1.44171142578125)    \n",
       "  (2.15936279296875,2.15997314453125)        …   (0.6226882934570312,0.6298294067382812)  \n",
       "  (0.11018943786621094,0.11021709442138672)      (0.48505401611328125,0.4862861633300781) \n",
       " (-1.8134918212890625,-1.8130340576171875)       (0.35936737060546875,0.3686637878417969) \n",
       "  (0.2515144348144531,0.2515830993652344)        (0.5339584350585938,0.5378952026367188)  \n",
       "  (1.088043212890625,1.0883331298828125)         (1.278839111328125,1.28448486328125)     "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Q*R"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10x3 Array{Unums.Ubound{3,4,UInt64},2}:\n",
       " (-0.000244140625,0.00030517578125)            …  (-0.0048980712890625,0.0048980712890625)     \n",
       " (-0.00018310546875,0.000152587890625)            (-0.004180908203125,0.0041961669921875)      \n",
       " (-0.0001068115234375,9.918212890625e-5)          (-0.0033416748046875,0.0033416748046875)     \n",
       " (-0.0001220703125,0.0001220703125)               (-0.0029878616333007812,0.002994537353515625)\n",
       " (-0.0001068115234375,9.918212890625e-5)          (-0.0029449462890625,0.002960205078125)      \n",
       " (-0.000335693359375,0.00030517578125)         …  (-0.00357818603515625,0.003570556640625)     \n",
       " (-1.430511474609375e-5,1.430511474609375e-5)     (-0.00061798095703125,0.00061798095703125)   \n",
       " (-0.000244140625,0.0002288818359375)             (-0.004634857177734375,0.004665374755859375) \n",
       " (-3.4332275390625e-5,3.814697265625e-5)          (-0.0019683837890625,0.00197601318359375)    \n",
       " (-0.000152587890625,0.000152587890625)           (-0.0028228759765625,0.002838134765625)      "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Q*R - X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Julia 0.4.3",
   "language": "julia",
   "name": "julia-0.4"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "0.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
